package com.region.integral.common_user.k.query.impl;

import org.springframework.stereotype.Component;

import com.region.integral.common_user.k.query.IKCurrencyQuery;
import com.region.integral.common_user.pojo.KCurrencyEntity;
import com.region.integral.exception.IntegralException;
import com.region.integral.hibernate.BaseHibernate;
@Component("common_user_KCurrencyQuery")
public class KCurrencyQueryImpl extends BaseHibernate implements IKCurrencyQuery {

	@Override
	public int getCurrKCurrency(int commonUserid) {
		int currK = 0;
		try {
			KCurrencyEntity kcEntity = getKCurrencyEntity(commonUserid);
			if(kcEntity != null){
				currK = kcEntity.getKcurrency();
			}
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return currK;
	}

	@Override
	public int getMaxKCurrency(int commonUserid) {
		int maxk = 0;
		try {
			KCurrencyEntity kcEntity = getKCurrencyEntity(commonUserid);
			if(kcEntity != null){
				maxk = kcEntity.getMaxKCurrency();
			}
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return maxk;
	}

}
